@echo off
REM === 1. 100%可安全删除部分 ===

REM 顶层

del /f /q get-pip.py
REM LICENSE.txt 仅许可证，可删
 del /f /q LICENSE.txt
REM pythonw.exe 仅GUI程序用，可删
del /f /q pythonw.exe

REM 以下为Python嵌入/标准库相关，OCR必需，不可删：
REM libcrypto-1_1.dll、libffi-7.dll、libssl-1_1.dll、pyexpat.pyd、python.cat、python.exe、python3.dll、python310.dll、python310.zip、python310._pth、select.pyd、sqlite3.dll、unicodedata.pyd、vcruntime140.dll、vcruntime140_1.dll、winsound.pyd、_asyncio.pyd、_bz2.pyd、_ctypes.pyd、_decimal.pyd、_elementtree.pyd、_hashlib.pyd、_lzma.pyd、_msi.pyd、_multiprocessing.pyd、_overlapped.pyd、_queue.pyd、_socket.pyd、_sqlite3.pyd、_ssl.pyd、_uuid.pyd、_zoneinfo.pyd

REM Scripts 目录下，保留 pip.exe/pip3.exe/pip3.10.exe，其余全部可删
del /f /q Scripts\aistudio.exe
del /f /q Scripts\chardetect.exe
del /f /q Scripts\cpuinfo.exe
del /f /q Scripts\f2py.exe
del /f /q Scripts\fleetrun.exe
del /f /q Scripts\futurize.exe
del /f /q Scripts\hf.exe
del /f /q Scripts\httpx.exe
del /f /q Scripts\huggingface-cli.exe
del /f /q Scripts\modelscope.exe
del /f /q Scripts\normalizer.exe
del /f /q Scripts\numpy-config.exe
del /f /q Scripts\paddleocr.exe
del /f /q Scripts\paddlex.exe
del /f /q Scripts\pasteurize.exe
del /f /q Scripts\pypdfium2.exe
del /f /q Scripts\tiny-agents.exe
del /f /q Scripts\tqdm.exe
del /f /q Scripts\wheel.exe

REM Lib\site-packages 下的 __pycache__ 可删
rmdir /s /q Lib\site-packages\__pycache__

REM === 2. 建议逐步验证后删除部分（先注释，逐步测试） ===

REM 包管理相关，理论可删，但如后续需升级依赖建议保留
REM rmdir /s /q Lib\site-packages\pip
REM rmdir /s /q Lib\site-packages\pip-25.2.dist-info
REM rmdir /s /q Lib\site-packages\setuptools
REM rmdir /s /q Lib\site-packages\setuptools-80.9.0.dist-info
REM rmdir /s /q Lib\site-packages\wheel
REM rmdir /s /q Lib\site-packages\wheel-0.45.1.dist-info
REM rmdir /s /q Lib\site-packages\distutils-precedence.pth
REM rmdir /s /q Lib\site-packages\_distutils_hack
REM rmdir /s /q Lib\site-packages\pkg_resources

REM PaddleOCR 可能不需要的第三方包，建议逐步测试删除
REM rmdir /s /q Lib\site-packages\aistudio_sdk
REM rmdir /s /q Lib\site-packages\aistudio_sdk-0.3.7.dist-info
REM rmdir /s /q Lib\site-packages\huggingface_hub
REM rmdir /s /q Lib\site-packages\huggingface_hub-0.34.4.dist-info
REM rmdir /s /q Lib\site-packages\modelscope
REM rmdir /s /q Lib\site-packages\modelscope-1.29.2.dist-info
REM rmdir /s /q Lib\site-packages\pypdfium2
REM rmdir /s /q Lib\site-packages\pypdfium2-4.30.0.dist-info
REM rmdir /s /q Lib\site-packages\pypdfium2_raw
REM rmdir /s /q Lib\site-packages\paddlex
REM rmdir /s /q Lib\site-packages\paddlex-3.2.1.dist-info
REM rmdir /s /q Lib\site-packages\httpx
REM rmdir /s /q Lib\site-packages\httpx-0.28.1.dist-info
REM rmdir /s /q Lib\site-packages\safetensors
REM rmdir /s /q Lib\site-packages\safetensors-0.6.2.dist-info
REM rmdir /s /q Lib\site-packages\baidubce
REM rmdir /s /q Lib\site-packages\bce_python_sdk-0.9.45.dist-info
REM rmdir /s /q Lib\site-packages\fsspec
REM rmdir /s /q Lib\site-packages\fsspec-2025.9.0.dist-info
REM rmdir /s /q Lib\site-packages\pydantic
REM rmdir /s /q Lib\site-packages\pydantic-2.11.8.dist-info
REM rmdir /s /q Lib\site-packages\pydantic_core
REM rmdir /s /q Lib\site-packages\pydantic_core-2.33.2.dist-info
REM rmdir /s /q Lib\site-packages\typing_inspection
REM rmdir /s /q Lib\site-packages\typing_inspection-0.4.1.dist-info

REM 其它如 annotated_types、anyio、click、colorama、colorlog、cpuinfo、exceptiongroup、filelock、future、google、h11、httpcore、idna、imagesize、libfuturize、libpasteurize、networkx、numpy、numpy.libs、opencv_contrib_python-4.10.0.84.dist-info、opt_einsum、packaging、prettytable、protobuf、psutil、pyclipper、pycryptodome、python_dateutil-2.9.0.post0.dist-info、pytz、PyYAML-6.0.2.dist-info、py_cpuinfo-9.0.0.dist-info、requests、ruamel、shapely、shapely.libs、six、sniffio、tqdm、typing_extensions、tzdata、ujson、ujson-stubs、urllib3、wcwidth、yaml 等，部分为PaddleOCR依赖，建议保留。

echo 清理完成。建议每次删除后测试OCR功能，确认无误再继续精简。
pause